import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  define: {
    __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "true",
  },
  plugins: [vue()],
  base: '/cy/',
  assetsDir: './assets',
  // mode: 'hash',
  server: {
    hmr: true,
    https: false,
    host: true,
    port: 8087,
    open: true,
    proxy: {
      '/ExampleModule': {
        target: 'http://localhost:2985',
        changeOrigin: true,
        rewrite: p => p.replace(/^\/ExampleModule/, 'ExampleModule'), //重写路径
      },
      '/ErrorPage': {
        target: 'http://localhost:2985',
        changeOrigin: true,
        rewrite: p => p.replace(/^\/ErrorPage/, 'ErrorPage'), //重写路径
      },
    },
  },
})
